#ifndef	_ADP_ENV_H
#define _ADP_ENV_H
#include "sys.h"
#include "ipadp.h"
#include "adp_cmd.h"
#include "adp_task.h"

#include "app_delay.h"
#include "nstar_light_glint.h"
#include "nstar_hcf4051.h"

extern void sys_log(char* fmt,...);

struct adp_env{
	unsigned int plat_ip;
	unsigned short plat_port;
	unsigned int pg_ip;
	unsigned short pg_port;
    
    unsigned int rsip;
	unsigned short rsport;
    unsigned int rpgip;
	unsigned short rpgport;

	unsigned int passback_ip;
	unsigned short passback_port;
    
	unsigned char phy_id[6];
	unsigned char logic_id[6];
    unsigned char rlogic_id[6];

	unsigned char register_1st_time;
    unsigned short passback_tp;
    unsigned short heart_tp;
    unsigned char fm_tp;
    unsigned int fm_fq;
};



extern unsigned short adpEnv_get_plat_port(void);
extern unsigned int adpEnv_get_passback_ip(void);
extern unsigned short adpEnv_get_passback_port(void);

unsigned char adpEnv_get_vol(void);
unsigned char adpEnv_set_vol(unsigned char vol);
unsigned char adpEnv_set_ip(unsigned char *ip);

unsigned char adpEnv_set_platip(unsigned char *ip, unsigned short port);
unsigned char adpEnv_set_pgip(unsigned char *ip, unsigned short port);
unsigned char adpEnv_set_backip(unsigned char *ip, unsigned short port);
unsigned char adpEnv_set_logicID(unsigned char *sourceid);
unsigned char adpEnv_set_trumpet(unsigned char val);
unsigned char adpEnv_get_trumpet(void);
unsigned char adpEnv_set_systime(unsigned int val);


unsigned char adpEnv_get_phyid(unsigned char *id, unsigned char len);

unsigned char adpEnv_get_register_1st_time(void);

unsigned int adpEnv_get_sip(void);




unsigned char adpEnv_set_heart_tp(unsigned short val);
unsigned short adpEnv_get_heart_tp(void);
unsigned char adpEnv_set_back_tp(unsigned short val);
unsigned short adpEnv_get_back_tp(void);
unsigned char adpEnv_set_fm_tp(unsigned short val);




#define ebmdbg_command(...) do{}while(0)
#define ebmdbg_rec(...) do{}while(0)
#define ebmdbg_fm(...) do{}while(0)
#define ebmdbg_board(...) do{}while(0)


unsigned char adpEnv_get_volmax(void);
unsigned char adpEnv_setfmfq(unsigned int val);
unsigned int adpEnv_getfmfq(void);

#endif
